package com.wipz.eoa.iphone.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	 public static String DEFAULT_DATE_PATTERN_EN = "yyyy-MM-dd HH:mm:ss";
	  public static String DEFAULT_DATE_PATTERN_CN = "yyyy-MM-dd HH:mm:ss";
	  private static final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	  private static SimpleDateFormat simpleDateFormat = null;

	  public static String currDateTime() {
			return df.format(new Date());
		}
	  
	  public static String dateToString(Date paramDate)
	  {
	    String str = "";
	    if (null != paramDate)
	    {
	      simpleDateFormat = new SimpleDateFormat(DEFAULT_DATE_PATTERN_EN);
	      str = simpleDateFormat.format(paramDate);
	    }
	    return str;
	  }

	  public static String dateToString(Date paramDate, String paramString)
	  {
	    String str = "";
	    if (null != paramDate)
	    {
	      simpleDateFormat = new SimpleDateFormat(paramString);
	      str = simpleDateFormat.format(paramDate);
	    }
	    return str;
	  }

	  public static Date stringToDate(String paramString)
	  {
	    Date localDate = null;
	    if ((null != paramString) && (!("".equals(paramString))))
	    {
	      simpleDateFormat = new SimpleDateFormat(DEFAULT_DATE_PATTERN_EN);
	      try
	      {
	        localDate = simpleDateFormat.parse(paramString);
	      }
	      catch (ParseException localParseException)
	      {
	        localParseException.printStackTrace();
	      }
	    }
	    return localDate;
	  }
	  
	  public static void main(String[] args) {
		  String password = "";
		  try {
			   password = com.toft.utils.StringUtils.cipher("wipz");
			  } catch (Exception e) {
			   e.printStackTrace();
			  }
			  System.out.println(password);
	}
}
